$(function(){
	
	var $btnAdd = $('#btnAdd');
	$btnAdd.click(function(){
		cateAdd();
	});
	
});

function cateAdd(){

	var $name 		= $('#name');
	var $parent 	= $('#parent');
	var $ord 		= $('#ord');
	var $disabled 	= $('#disabled');

	var name 		= $name.val();
	var parent 		= $parent.val();
	var ord 		= $ord.val();
	var disabled 	= $('input[name="disabled"]:checked').val();
	
	var params = {
		'name':name,
		'parent':parent,
		'ord':ord,
		'disabled':disabled
	}

	$.post('/index.php/Admin/ArticleCate/add_do',params,function(data){
		if(data.success){
			alert('分类添加成功');
			location.reload(true);
		}else{
			alert('分类添加失败');
		}
	},'json');
}